<?php

namespace app\admin\model;

use think\Model;

class Zhifubao extends Model
{
    // 表名
    protected $name = 'zhifubao';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    
    // 追加属性
    protected $append = [
        'IDTypedata_text',
        'alipaydata_text',
        'bank_text',
        'status_text'
    ];
    

    
    public function getIdtypedataList()
    {
        return ['三证合一营业执照' => __('三证合一营业执照'),'普通营业执照' => __('普通营业执照')];
    }     

    public function getAlipaydataList()
    {
        return ['有企业支付宝' => __('有企业支付宝'),'无企业支付宝' => __('无企业支付宝')];
    }     

    public function getBankList()
    {
        return ['one' => __('Bank one'),'two' => __('Bank two'),'three' => __('Bank three'),'four' => __('Bank four'),'five' => __('Bank five'),'six' => __('Bank six'),'seven' => __('Bank seven'),'eight' => __('Bank eight'),'nine' => __('Bank nine'),'ten' => __('Bank ten')];
    }     

    public function getStatusList()
    {
        return ['0' => __('Status 0'),'1' => __('Status 1')];
    }     


    public function getIdtypedataTextAttr($value, $data)
    {        
        $value = $value ? $value : $data['IDTypedata'];
        $list = $this->getIdtypedataList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getAlipaydataTextAttr($value, $data)
    {        
        $value = $value ? $value : $data['alipaydata'];
        $list = $this->getAlipaydataList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getBankTextAttr($value, $data)
    {        
        $value = $value ? $value : $data['bank'];
        $list = $this->getBankList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getStatusTextAttr($value, $data)
    {        
        $value = $value ? $value : $data['status'];
        $list = $this->getStatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
